from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

router = DefaultRouter()
router.register(r'tasks', views.AnalysisTaskViewSet, basename='task')
router.register(r'sources', views.DataSourceViewSet, basename='source')
router.register(r'results', views.AnalysisResultViewSet, basename='result')
router.register(r'data-sources', views.DataSourceViewSet, basename='data-source')
router.register(r'reports', views.ReportViewSet, basename='report')

app_name = 'data_analysis'

urlpatterns = [
    path('', include(router.urls)),
    path('dashboard/', views.DashboardView.as_view(), name='dashboard'),
    path('weibo/visualization/', views.WeiboVisualizationView.as_view(), name='weibo-visualization'),
    path('trend/', views.TrendView.as_view(), name='trend'),
    path('distribution/', views.DistributionView.as_view(), name='distribution'),
    path('topics/', views.TopicAnalysisView.as_view(), name='topics'),
    path('sentiment/', views.SentimentAnalysisView.as_view(), name='sentiment'),
    path('users/rankings/', views.UserRankingView.as_view(), name='user-rankings'),
] 